import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path' // 安装 @types/node 模块
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      // '@' : '/src/'
      '@': resolve(__dirname, 'src')
    }
  },
  server: {
    port: 3000,
    open: true,
    proxy: {
      '/api': {
        target: 'http://baobab.kaiyanapp.com/api/v4/discovery/',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, ''),
        ws: false
      }
    }
  }
})
